﻿using M56.Core.Utils;

namespace BarrageGameAssistant.Core.Configs
{
    public class Licence
    {
        /// <summary>
        /// 设备识别码
        /// </summary>
        public string Mac { get; set; } = string.Empty;

        /// <summary>
        /// 密钥
        /// </summary>
        public string Key { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; } = string.Empty;

        /// <summary>
        /// 创建标记
        /// </summary>
        public int UseCreate { get; set; } = 0;

        /// <summary>
        /// 编辑标记
        /// </summary>
        public int UseEdit { get; set; } = 0;

        /// <summary>
        /// 使用游戏过程处理
        /// </summary>
        public int UseGameProcess { get; set; } = 0;

        /// <summary>
        /// 锁定游戏进程
        /// </summary>
        public int Lock { get; set; } = 0;

        /// <summary>
        /// 进程列表
        /// </summary>
        public string Process { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 过期时间
        /// </summary>
        public DateTime? ExpTime { get; set; }

        /// <summary>
        /// 状态 1 禁用
        /// </summary>
        public int Status { get; set; }

        public static Licence? FromJson(string json)
        {
            return JsonUtils.FromJson<Licence>(json);
        }
    }
}
